home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
LIBRARY
/
PASCALL
/
LIFE
/
LIFE.TXT
< prev
Wrap
Text File
|
1993-09-04
|
789b
|
28 lines
Life.pas
Life was originally a program that demonstrated the mathematical lifeforms.
this is a reproduction(from scratch math)....
the math is.. from a grid. at any point on that grid:
from the sum of the surrounding eight points:
ooo x is the point
oxo o's are the surrounding points
ooo
case sum of
0,1,4,5,6,7,8: x dies
2: x lives
3: x lives/born
end;
that means if the sum is 0,1, or 4 through 8, the point on x is no more
else if it is 2 or 3 the point stays how it is. if the sum is three and
at the point there is no life at the momment, then one is born.
My implementation is a bit slow mainly because of the HIGH grid size..
I think I had a constant that you can change easily to change the size..
thats all, and enjoy..